package rubymatic;

//import org.hibernate.proxy.map.MapLazyInitializer;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.proxy.LazyInitializer;

import org.jruby.Ruby;
import org.jruby.RubyArray;
import org.jruby.RubyBoolean;
import org.jruby.RubyClass;
import org.jruby.RubyFloat;
import org.jruby.RubyHash;
import org.jruby.RubyInteger;
import org.jruby.RubyObject;
//import org.jruby.RubyModule;
//import org.jruby.RubyFixnum;
import org.jruby.RubyProc;
import org.jruby.RubyString;
import org.jruby.anno.JRubyMethod;
import org.jruby.javasupport.JavaUtil;
import org.jruby.runtime.Block;
//import org.jruby.runtime.CallType;
import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.builtin.Variable;
import org.jruby.runtime.builtin.InstanceVariables;
import org.jruby.runtime.builtin.InternalVariables;

import java.io.Serializable;
//import java.util.Collection;
//import java.util.Map;
//import java.util.Set;
//import java.util.Iterator;
import java.util.List;


import org.jruby.runtime.builtin.IRubyObject;

public class RubyProxy extends RubyObject implements HibernateProxy, /*IRubyObject,*/ Serializable
{

    private RubyLazyInitializer li;


    public RubyProxy(Ruby runtime, RubyClass klass) {
        super(runtime, klass);
    }

    public Object writeReplace() {
        return this;
    }

    public void setHibernateLazyInitializer(RubyLazyInitializer li) {
    	this.li = li;
    }
    
    public LazyInitializer getHibernateLazyInitializer() {
        return li;
    }

    public IRubyObject ruby_li(Block block){
		return JavaUtil.convertJavaToUsableRubyObject(getRuntime(), li);
	}

}
